package com.mylab.hibernate.bean;

import java.io.Serializable;

public class Reference implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2892113799391452030L;

	private Long id;
	
	private String code;
	
	private String label;

	public Reference() {
		
	}
	
	/**
	 * @param id
	 * @param code
	 * @param label
	 */
	public Reference(Long id, String code, String label) {
		super();
		this.id = id;
		this.code = code;
		this.label = label;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long idPlant) {
		this.id = idPlant;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	@Override
	public String toString() {
		return "Reference [id=" + id + ", code=" + code + ", label="+ label + "]";
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((code == null) ? 0 : code.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((label == null) ? 0 : label.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Reference other = (Reference) obj;
		if (code == null) {
			if (other.code != null)
				return false;
		} else if (!code.equals(other.code))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (label == null) {
			if (other.label != null)
				return false;
		} else if (!label.equals(other.label))
			return false;
		return true;
	}
	

	
}
